package com.csust.automaticteach.service;

import com.csust.automaticteach.app.common.ExerciseEvaluateApp;
import com.csust.automaticteach.model.dto.exercisessubmit.JudgeExercisesRequest;
import com.csust.automaticteach.model.entity.ExercisesSubmit;
import com.baomidou.mybatisplus.extension.service.IService;
import com.csust.automaticteach.model.entity.User;
import com.csust.automaticteach.model.vo.exercisessubmit.ExercisesSubmitVO;
import reactor.core.publisher.Flux;

import java.util.List;

/**
* @author 钰玟
* @description 针对表【t_exercises_submit(练习提交表)】的数据库操作Service
* @createDate 2025-08-20 17:50:56
*/
public interface ExercisesSubmitService extends IService<ExercisesSubmit> {

    /**
     * 判题
     * @param judgeExercisesRequest 判题请求
     * @param loginUser 登录用户
     * @return 判题结果
     */
    List<ExerciseEvaluateApp.judgeResponse> judgeExercises(JudgeExercisesRequest judgeExercisesRequest,User loginUser);

    /**
     * 判题结果流
     * @param judgeExercisesRequest 判题请求
     * @param loginUser 登录用户
     * @return 判题结果
     */
    Flux<String> judgeExercisesByStream(JudgeExercisesRequest judgeExercisesRequest, User loginUser);

    /**
     * 更新提交结果
     * @param judgeResponse 判题结果
     */
    void updateSubmitResult(ExerciseEvaluateApp.judgeResponse judgeResponse);
}
